//
//  SetViewController.m
//  YouGoWeGo
//
//  Created by Dai on 14/11/19.
//  Copyright (c) 2014年 LiuFei. All rights reserved.
//

#import "SetViewController.h"
#import "OurViewController.h"
#import "SytemDetailViewController.h"
@interface SetViewController ()<UITableViewDataSource, UITableViewDelegate, UIAlertViewDelegate>

@end

@implementation SetViewController
- (void)dealloc
{
    [super dealloc];
}
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        
    }
    return self;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view setBackgroundColor:[UIColor whiteColor]];
    self.navigationController.navigationBar.translucent = NO;
    [self.navigationItem setTitle:@"关于我们"];
    [self creatTable];
    
}
#pragma mark -
#pragma TableView
- (void)creatTable
{
    self.table = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) style:UITableViewStylePlain];
    [_table setBackgroundColor:[UIColor whiteColor]];
    _table.dataSource = self;
    _table.delegate = self;
    _table.rowHeight = 50;
    [self.view addSubview:_table];

}
#pragma mark -
#pragma TableViewCell
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSMutableArray *array = [NSMutableArray arrayWithObjects:@"关于我们", @"软件详情", @"清除缓存", nil];
    static NSString *cellIdentify = @"cellIdentify";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentify];
    if (!cell) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentify] autorelease];
        
    }
    [cell.textLabel setText:[array objectAtIndex:indexPath.row]];
    return cell;

}
#pragma mark -
#pragma cell个数
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 3;
    
}
#pragma mark -
#pragma 跳转
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    self.indexPath = indexPath;
    if (indexPath.row == 0) {
        OurViewController *our = [[OurViewController alloc] init];
        [self.navigationController pushViewController:our animated:YES];
        [our release];
    }
    if (indexPath.row == 1) {
        SytemDetailViewController *sytem = [[SytemDetailViewController alloc] init];
        [self.navigationController pushViewController:sytem animated:YES];
        [sytem release];
    }
    if (indexPath.row == 2) {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"是否清除缓存" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
        [self.view addSubview:alert];
        [alert show];
        [alert release];
        
    }
    

}

#pragma mark -
#pragma AlertView清除事件
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    


}









/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
